# Maintainer:
pkgname=protoc-gen-js
pkgver=3.21.4
pkgrel=1
pkgdesc="protoc-gen-js javascript protobuf generator"
url="https://github.com/protocolbuffers/protobuf-javascript"
# bazel
arch="x86_64 aarch64"
license="BSD-3-Clause AND Apache-2.0"
depends="protoc"
makedepends="bazel7 linux-headers"
source="$pkgname-$pkgver.tar.gz::https://github.com/protocolbuffers/protobuf-javascript/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/protobuf-javascript-$pkgver"
# bazel stuff, no tests
options="net !check"

build() {
	# prevent broken ccache use
	JAVA_HOME=/usr/lib/jvm/java-21-openjdk \
	PATH=/bin:/usr/bin \
		bazel build plugin_files
}

package() {
	install -Dm755 bazel-bin/generator/protoc-gen-js -t "$pkgdir"/usr/bin
}

sha512sums="
8fc8e037969466e678036e59ac7892d6493657e40ab09f109e78e6f3457d81bf644cd98e6603da31912c1841d51e9fe49ca16214b81fe6039e2268454921601d  protoc-gen-js-3.21.4.tar.gz
"
